{% extends 'student_management/base.html' %}

{% block content %}
<div class="card">
    <div class="card-header">
        <h3>评价教师 - {{ teacher.name }}</h3>
        <p class="mb-0">课程：{{ course.name }}</p>
    </div>
    <div class="card-body">
        <form method="post">
            {% csrf_token %}
            {% if not user.student and students %}
            <div class="mb-3">
                <label class="form-label">选择学生</label>
                <select name="student" class="form-control" required>
                    <option value="">请选择学生</option>
                    {% for student in students %}
                    <option value="{{ student.id }}">{{ student.name }} ({{ student.student_id }})</option>
                    {% endfor %}
                </select>
            </div>
            {% endif %}
            <div class="mb-3">
                <label class="form-label">评分</label>
                <div class="btn-group" role="group">
                    {{ form.rating }}
                </div>
            </div>
            <div class="mb-3">
                <label class="form-label">评价内容</label>
                {{ form.comment }}
            </div>
            <button type="submit" class="btn btn-primary">提交评价</button>
            <a href="{% url 'course-list' %}" class="btn btn-secondary">返回</a>
        </form>
    </div>
</div>
{% endblock %} 